package com.user_hosted_storage.server.bl;

import java.util.List;

import javax.ejb.Remote;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.MediaType;

import com.user_hosted_storage.dto.ClientDTO;
import com.user_hosted_storage.dto.CommunityDTO;
import com.user_hosted_storage.dto.CommunityMemberDTO;

@Path("/client/")
@Remote
public interface CustomersManagerRemote {

	@POST
	@Path("/public/registerClient")
	@Produces(MediaType.APPLICATION_JSON)
	ClientDTO registerClient(@QueryParam("userName") String userName, @QueryParam("passwordHash")String passwordHash, @QueryParam("email")String email,@QueryParam("sharedSizeGB")long sharedSizeGB, @QueryParam("maximumBitrate")long maximumBitrate);

	@POST
	@Path("/private/loginClient")
	@Produces(MediaType.APPLICATION_JSON)
	ClientDTO loginClient();

	@POST
	@Path("/private/placeFile")
	@Produces(MediaType.APPLICATION_JSON)
	List<CommunityMemberDTO> placeFile(@QueryParam("fileSize")double fileSize, @QueryParam("communityId")long communityId);

	@POST
	@Path("/private/createCommunity")
	@Produces(MediaType.APPLICATION_JSON)
	CommunityDTO createCommunity(@QueryParam("name")String name);
	
	@POST
	@Path("/private/joinCommunity")
	void joinCommunity(@QueryParam("communityId")long communityId,@QueryParam("shareSize")long shareSize);

	
	void updateIP(String remoteAddr);

	@POST
	@Path("/private/getMyCommunities")
	@Produces(MediaType.TEXT_PLAIN)
	String getMyCommunities();

	@POST
	@Path("/private/inviteToCommunity")
	void inviteToCommunity(@QueryParam("communityId")long communityId, @QueryParam("clientId")long clientId);
	
	void registerJabber(long clientId);

	@POST
	@Path("/private/getCommunity")
	@Produces(MediaType.APPLICATION_JSON)
	CommunityDTO getCommunity(@QueryParam("communityId")long communityId);

	@POST
	@Path("/private/getClient")
	@Produces(MediaType.APPLICATION_JSON)
	ClientDTO getClient(@QueryParam("clientId")long clientId);
	
	void updateAcceptPort(int port);

	void updateConnectPort(int port);


	
}
